package com.keepers.repair.adapter;

import android.graphics.Color;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.keepers.repair.R;
import com.keepers.repair.model.GetTaskListModel;

/**
 * auth aboom
 * date 2018/11/17
 */
public class TaskTodayAdapter extends BaseQuickAdapter<GetTaskListModel, BaseViewHolder> {

    public TaskTodayAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, GetTaskListModel item) {
        if (helper.getAdapterPosition() % 2 == 0) {
            helper.itemView.setBackgroundColor(Color.parseColor("#FFFFFF"));
        } else {
            helper.itemView.setBackgroundColor(Color.parseColor("#F1FEFE"));
        }
        helper.setText(R.id.task_name, item.TaskName);
        helper.setText(R.id.start_data, item.StartData);
        helper.setText(R.id.end_data, item.EndData);
        if ("乱序巡逻".equals(item.WordName)) {
            helper.setText(R.id.start_data, item.DataTime);
            helper.setText(R.id.end_data, item.OnePointTime);
        }
    }
}
